package com.yanmaohu.yulia.statement;

import com.yanmaohu.yulia.bean.SimpleValueSpecification;
import com.yanmaohu.yulia.bean.SqlStatementName;

/**
 * @author Bright Lee
 */
public final class PrepareStatement implements SqlDynamicStatement, Statement {

    private int beginIndex;
    private int endIndex;
    private SqlStatementName sqlStatementName;
    private SimpleValueSpecification attributesVariable;
    private SimpleValueSpecification sqlStatementVariable;

    public PrepareStatement(int beginIndex,
                            SqlStatementName sqlStatementName,
                            SimpleValueSpecification attributesVariable,
                            SimpleValueSpecification sqlStatementVariable) {
        this.beginIndex = beginIndex;
        this.endIndex = sqlStatementVariable.getEndIndex();
        this.sqlStatementName = sqlStatementName;
        this.attributesVariable = attributesVariable;
        this.sqlStatementVariable = sqlStatementVariable;
    }

    @Override
    public int getBeginIndex() {
        return beginIndex;
    }

    @Override
    public int getEndIndex() {
        return endIndex;
    }

    public SqlStatementName getSqlStatementName() {
        return sqlStatementName;
    }

    public SimpleValueSpecification getAttributesVariable() {
        return attributesVariable;
    }

    public SimpleValueSpecification getSqlStatementVariable() {
        return sqlStatementVariable;
    }

}
